<?php
/**
 * Created by PhpStorm.
 * User: yangyulu
 * Date: 2020/3/1
 * Time: 下午7:56
 */
class Project_commentModel extends Model{
    public function medal($userId){
        $count=$this->where(["user_id=?","status=?","type=?"],[$userId,1,1])->count();
        switch ($count){
            case 30:
                self::model("user_medal")->insert(["medal_id"=>2,"user_id"=>$userId,"add_time"=>date("Y-m-d  H:i:s",time())]);
                break;
            default:
                break;
        }
    }
}